In [1]:
import sa_groundwater_data as gwdata

Define a box somewhere in South Australia:


In [2]:
x0 = 139.6
x1 = 139.8

y1 = -36.8
y0 = -37.

Now find all the wells in that box, up to maximum of 10K (then have to reduce the size of the box)


In [12]:
wells = gwdata.web.find_dhs_in_box(x0, x1, y0, y1)
print len(wells)
wells[0]


332
Out[12]:
{u'CHEM': u'N',
 u'CLASS': u'WW',
 u'DHNO': 79980,
 u'HSTRATLOG': u'N',
 u'LAT': -36.8988016,
 u'LATEST_OPEN_DATE': u'1968-09-01',
 u'LATEST_OPEN_DEPTH': 2.13,
 u'LATEST_SAL_DATE': u'1968-09-01',
 u'LATEST_SWL_DATE': u'1968-09-01',
 u'LITHOLOG': u'N',
 u'LOGDRILL': u'N',
 u'LON': 139.7966611,
 u'MAPNUM': 682400240.0,
 u'MAX_DEPTH': 2.13,
 u'NRM': u'South East',
 u'OBSWELL': u'N',
 u'PWA': u'Lower Limestone Coast',
 u'SAL': u'Y',
 u'STAT_DESC': u'ABD',
 u'STRATLOG': u'N',
 u'SWL': 1.22,
 u'TDS': 830,
 u'WATER': u'Y'}

In [22]:
[w['DHNO'] for w in wells]


Out[22]:
[79980,
 79982,
 79983,
 79984,
 79985,
 79986,
 79987,
 79988,
 79989,
 79990,
 79991,
 79992,
 79993,
 79994,
 79995,
 79996,
 79997,
 79998,
 79999,
 80000,
 80001,
 80002,
 80003,
 80004,
 80005,
 80008,
 80044,
 80045,
 80046,
 80047,
 80048,
 80049,
 80050,
 80051,
 80052,
 80053,
 80055,
 80057,
 80058,
 80059,
 80060,
 80061,
 80062,
 80063,
 80064,
 80065,
 80066,
 80067,
 80068,
 80069,
 80070,
 80071,
 80072,
 80073,
 80074,
 80075,
 80076,
 80077,
 80078,
 80079,
 80080,
 80081,
 80332,
 80341,
 80342,
 80345,
 80346,
 80347,
 80348,
 80349,
 80350,
 80351,
 80352,
 80353,
 80354,
 80355,
 80356,
 80357,
 80358,
 80359,
 80360,
 80361,
 80362,
 80363,
 80364,
 80365,
 80366,
 80367,
 80368,
 80369,
 80370,
 80371,
 80372,
 80373,
 80374,
 80375,
 80376,
 80377,
 80378,
 80379,
 80380,
 80381,
 80382,
 80383,
 80384,
 80385,
 80386,
 80387,
 80388,
 80389,
 80390,
 80391,
 80392,
 80393,
 80394,
 80395,
 80396,
 80397,
 80398,
 80399,
 80400,
 80401,
 80402,
 80403,
 80404,
 80405,
 80406,
 80407,
 80408,
 80409,
 80410,
 80411,
 80412,
 80413,
 80414,
 80415,
 80416,
 80417,
 80418,
 80419,
 80420,
 80421,
 80422,
 80423,
 80424,
 80425,
 80426,
 80427,
 80428,
 80429,
 80430,
 80431,
 80432,
 80433,
 80434,
 80435,
 80436,
 80437,
 80438,
 80439,
 80440,
 80441,
 80442,
 80443,
 80444,
 80445,
 80446,
 80591,
 80592,
 80593,
 80594,
 80595,
 80596,
 80597,
 80598,
 80599,
 80600,
 80601,
 80602,
 80603,
 80604,
 80605,
 80606,
 80607,
 80608,
 80609,
 80615,
 80616,
 80645,
 80666,
 80817,
 80835,
 80836,
 80838,
 80850,
 80851,
 80885,
 80896,
 80910,
 80971,
 80972,
 81026,
 81051,
 81053,
 81054,
 81055,
 81086,
 81090,
 81118,
 81119,
 81120,
 81150,
 81165,
 81174,
 81197,
 81207,
 81211,
 81219,
 81260,
 81261,
 81263,
 81301,
 81343,
 81401,
 81404,
 81415,
 132641,
 134385,
 134386,
 135510,
 135511,
 135584,
 135828,
 144903,
 144902,
 146270,
 146268,
 153490,
 153491,
 153919,
 153921,
 154438,
 155108,
 157973,
 165995,
 165996,
 165997,
 165999,
 166000,
 166001,
 166508,
 170178,
 174254,
 174257,
 174262,
 78928,
 176660,
 178889,
 181775,
 181777,
 181768,
 181782,
 181784,
 182281,
 182274,
 187041,
 187007,
 189366,
 187009,
 190179,
 191752,
 195513,
 196052,
 196985,
 196986,
 196987,
 196988,
 196989,
 196990,
 196991,
 196992,
 196993,
 196994,
 196995,
 196996,
 196997,
 196998,
 196999,
 197000,
 197001,
 197002,
 197003,
 197004,
 197005,
 197006,
 197007,
 197008,
 197009,
 197010,
 197011,
 197012,
 197013,
 197014,
 197015,
 197016,
 197017,
 197018,
 197216,
 201675,
 209598,
 229017,
 229212,
 229213,
 229584,
 229585,
 229586,
 231172,
 238735,
 238739,
 238740,
 238741,
 239993,
 240028,
 259671,
 266296,
 270241,
 275293,
 275471,
 275474,
 279008,
 280848,
 280849]

In [13]:
table = gwdata.wells.get_table_from_data(wells)
print len(table)
table.keys()


36
Out[13]:
[u'OBSNETWORK',
 u'SWL',
 u'LON',
 u'DHNO',
 u'STAT_DESC',
 u'LATEST_YIELD_DATE',
 u'LATEST_SWL_DATE',
 u'CHEM',
 u'LITHOLOG',
 u'SAL',
 u'PERMIT_NO',
 u'DRILL_DATE',
 u'LATEST_OPEN_DEPTH',
 u'PURP_DESC',
 u'CLASS',
 u'REPLACEUNITNUM',
 u'LATEST_SAL_DATE',
 u'MAPNUM',
 u'YIELD',
 u'SWLSTATUS',
 u'HSTRATLOG',
 u'STRATLOG',
 u'LAT',
 u'AQ_MON',
 u'LOGDRILL',
 u'NAME',
 u'NRM',
 u'SALSTATUS',
 u'MAX_DEPTH',
 u'WATER',
 'DRILLHOLE_NO',
 u'OBSNUMBER',
 u'OBSWELL',
 u'PWA',
 u'TDS',
 u'LATEST_OPEN_DATE']

In [14]:
wells_df = gwdata.wells.table_as_df(table, index='DHNO')

In [15]:
wells_df


Out[15]:
AQ_MON CHEM CLASS DRILLHOLE_NO DRILL_DATE HSTRATLOG LAT LATEST_OPEN_DATE LATEST_OPEN_DEPTH LATEST_SAL_DATE ... REPLACEUNITNUM SAL SALSTATUS STAT_DESC STRATLOG SWL SWLSTATUS TDS WATER YIELD
DHNO
79980 N WW 79980 N -36.898802 1968-09-01 2.13 1968-09-01 ... Y ABD N 1.22 830 Y
79982 N WW 79982 N -36.901460 1968-09-01 7.93 1968-09-01 ... Y OPR N 2.64 345 Y
79983 N WW 79983 N -36.903946 1968-09-11 ... Y OPR N 1.19 2485 Y
79984 N WW 79984 N -36.911001 1968-09-11 ... Y OPR N 1570 N
79985 N WW 79985 1973-10-10 N -36.912338 1973-10-10 8.23 1973-10-18 ... Y N 3.05 365 Y 1.55
79986 N WW 79986 N -36.922232 1968-09-11 5.18 1968-09-11 ... Y OPR N 1.4 4470 Y
79987 N WW 79987 N -36.919414 1968-09-11 0.91 1968-09-11 ... Y ABD N 0.3 770 Y
79988 N WW 79988 1952-01-01 N -36.925559 1968-09-11 4.88 1968-09-11 ... Y ABD N 1.35 645 Y
79989 N WW 79989 N -36.927901 1968-09-11 6.4 1968-09-11 ... Y N 1.58 1900 Y
79990 N WW 79990 N -36.928374 1968-09-11 6.1 1968-09-11 ... Y N 1.91 1955 Y
79991 N WW 79991 N -36.929444 1968-09-11 7.32 1968-09-11 ... Y OPR N 2.11 1955 Y
79992 N WW 79992 N -36.929110 1970-05-18 6.55 1977-03-24 ... Y N OPR N 2.18 H 1687 Y
79993 N WW 79993 N -36.939699 1968-10-05 3.66 1968-10-05 ... Y OPR N 0.46 830 Y
79994 N WW 79994 1959-01-01 N -36.941163 1968-09-05 3.05 1968-09-05 ... Y OPR N 0.91 830 Y
79995 N WW 79995 N -36.941748 1968-09-05 3.35 ... N OPR N 1.22 Y
79996 N WW 79996 N -36.937575 ... N OPR N N
79997 N WW 79997 1968-09-05 N -36.943361 1977-02-04 13 1968-09-05 ... Y OPR N 0.36 503 Y
79998 N WW 79998 N -36.939300 1968-10-02 1.82 1968-10-02 ... Y OPR N 0.31 1145 Y
79999 N WW 79999 N -36.939040 1968-10-02 2.13 1968-10-02 ... Y OPR N 0.91 1145 Y
80000 N WW 80000 N -36.935906 1968-10-02 4.86 ... N OPR N 1.24 Y
80001 N WW 80001 N -36.930065 1968-10-02 5.49 1968-10-02 ... Y OPR N 1.52 2485 Y
80002 N WW 80002 N -36.942296 2010-05-11 50 1974-05-14 ... Y ABD N 0 744 Y 0.65
80003 Twd N WW 80003 1968-01-01 N -36.942329 1988-03-09 54 1988-03-10 ... Y N 2 860 Y 3
80004 N WW 80004 N -36.942516 1968-10-05 5.49 1968-10-05 ... Y OPR N 1.27 915 Y
80005 N WW 80005 N -36.929874 1968-10-02 6.1 1968-10-02 ... Y OPR N 1.07 2085 Y
80008 N WW 80008 N -36.919792 1968-09-04 ... Y OPR N 1515 N
80044 N WW 80044 N -36.950995 1993-10-13 6.49 1999-03-15 ... Y OPR N 0.88 430 Y
80045 N WW 80045 N -36.952405 1993-10-13 ... N N 0.99 Y
80046 N WW 80046 N -36.947757 1968-10-05 4.57 ... N OPR N 0.61 Y
80047 N WW 80047 N -36.949600 1993-10-13 10.79 1999-03-15 ... Y OPR N 5.46 444 Y
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
197014 N WW 197014 2003-06-19 N -36.946950 2003-06-19 8.39 ... N N 2.07 Y
197015 N WW 197015 2003-06-19 N -36.950343 2003-06-19 16.75 ... N N 4.4 Y
197016 N WW 197016 2003-06-23 N -36.943552 2003-06-23 8.91 ... N N 3.96 Y
197017 N WW 197017 2003-06-23 N -36.960279 2003-06-23 11.18 ... N N 6.63 Y
197018 N WW 197018 2003-06-25 N -36.963599 2003-06-25 9.01 ... N N 5.57 Y
197216 N WW 197216 N -36.961026 ... N OPR N N
201675 N WW 201675 2004-05-15 Y -36.943105 2004-05-15 0 ... N ABD N N
209598 Y WW 209598 2005-08-08 Y -36.943951 2005-08-08 0 2005-08-08 ... Y BKF N 23989 N 5
229017 N WW 229017 2007-02-20 N -36.969539 2007-02-20 36 2007-02-20 ... Y N 15.5 446 Y 10
229212 N WW 229212 2007-02-27 N -36.962122 2007-02-27 8 2007-02-27 ... Y N 5.1 462 Y 2.5
229213 N WW 229213 2006-11-06 N -36.956359 2006-11-06 9.1 2006-11-07 ... Y N 6 739 Y 1
229584 N WW 229584 2007-04-27 N -36.944485 2007-04-27 6 2007-04-25 ... Y N 2.54 383 Y 6
229585 N WW 229585 2007-05-08 N -36.944484 2007-05-08 54 2007-05-07 ... Y N 1.99 443 Y 16
229586 N WW 229586 2007-04-27 Y -36.943864 2007-04-27 54 2007-04-27 ... Y N 1.58 480 Y 16
231172 N WW 231172 N -36.971231 2007-07-19 30 2007-07-19 ... Y N 6 363 Y 2
238735 Y WW 238735 2008-08-28 Y -36.967137 2008-08-28 42 2008-08-28 ... Y N 6 413 Y 2
238739 Y WW 238739 2008-08-25 N -36.912153 2008-08-25 7.2 ... N N 3 Y 2.5
238740 Y WW 238740 2008-08-15 N -36.946235 2008-08-15 9 2008-08-15 ... Y N 1 628 Y 1.25
238741 Y WW 238741 2008-08-20 N -36.944443 2008-08-20 9 2008-08-20 ... Y N 1 966 Y 1.25
239993 Y WW 239993 2008-08-29 N -36.970365 2008-08-29 18 2008-08-29 ... Y N 5.8 396 Y 2
240028 Y WW 240028 2008-08-22 N -36.969527 2008-08-22 13 2008-08-22 ... Y N 6.5 385 Y 1.25
259671 N WW 259671 2010-10-30 N -36.945925 2010-10-30 7.1 2010-10-30 ... Y N 2.9 1446 Y 1
266296 N WW 266296 N -36.969951 2011-08-19 9.3 2011-08-19 ... Y N 5.4 407 Y 2.2
270241 N WW 270241 2009-12-14 N -36.918333 2009-12-14 10 2009-12-14 ... Y N 1.5 799 Y
275293 N WW 275293 2013-05-31 N -36.963733 2013-05-31 12 ... N N N 4.64 C Y
275471 N WW 275471 2013-03-10 N -36.958963 2013-03-10 8.7 2013-03-18 ... Y N 2.6 514 Y 5
275474 N WW 275474 2013-03-11 N -36.960237 2013-03-11 9 2013-03-18 ... Y N 4.5 407 Y 2
279008 N WW 279008 2010-01-09 N -36.923889 2010-01-09 42 2010-01-09 ... Y N 1.5 13683 Y
280848 N WW 280848 N -36.948135 2013-11-16 5 2013-11-16 ... Y N 1.7 694 Y 1
280849 N WW 280849 N -36.963157 2013-11-17 6.8 2013-11-17 ... Y N 4.7 865 Y 1.2

332 rows × 35 columns


In [16]:
import matplotlib.pyplot as plt
%matplotlib inline

In [17]:
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
ax.scatter(wells_df.LON, wells_df.LAT)


Out[17]:
<matplotlib.collections.PathCollection at 0x6b17210>

In [18]:
wells2 = gwdata.wells.get_ldicts_from_table(table)

In [20]:
import pprint
pprint.pprint(wells2[:2])


[{u'AQ_MON': '',
  u'CHEM': u'N',
  u'CLASS': u'WW',
  u'DHNO': 79980,
  'DRILLHOLE_NO': 79980,
  u'DRILL_DATE': '',
  u'HSTRATLOG': u'N',
  u'LAT': -36.8988016,
  u'LATEST_OPEN_DATE': u'1968-09-01',
  u'LATEST_OPEN_DEPTH': 2.13,
  u'LATEST_SAL_DATE': u'1968-09-01',
  u'LATEST_SWL_DATE': u'1968-09-01',
  u'LATEST_YIELD_DATE': '',
  u'LITHOLOG': u'N',
  u'LOGDRILL': u'N',
  u'LON': 139.7966611,
  u'MAPNUM': 682400240.0,
  u'MAX_DEPTH': 2.13,
  u'NAME': '',
  u'NRM': u'South East',
  u'OBSNETWORK': '',
  u'OBSNUMBER': '',
  u'OBSWELL': u'N',
  u'PERMIT_NO': '',
  u'PURP_DESC': '',
  u'PWA': u'Lower Limestone Coast',
  u'REPLACEUNITNUM': '',
  u'SAL': u'Y',
  u'SALSTATUS': '',
  u'STAT_DESC': u'ABD',
  u'STRATLOG': u'N',
  u'SWL': 1.22,
  u'SWLSTATUS': '',
  u'TDS': 830,
  u'WATER': u'Y',
  u'YIELD': ''},
 {u'AQ_MON': '',
  u'CHEM': u'N',
  u'CLASS': u'WW',
  u'DHNO': 79982,
  'DRILLHOLE_NO': 79982,
  u'DRILL_DATE': '',
  u'HSTRATLOG': u'N',
  u'LAT': -36.9014596,
  u'LATEST_OPEN_DATE': u'1968-09-01',
  u'LATEST_OPEN_DEPTH': 7.93,
  u'LATEST_SAL_DATE': u'1968-09-01',
  u'LATEST_SWL_DATE': u'1968-09-01',
  u'LATEST_YIELD_DATE': '',
  u'LITHOLOG': u'N',
  u'LOGDRILL': u'N',
  u'LON': 139.7982691,
  u'MAPNUM': 682400242.0,
  u'MAX_DEPTH': 7.93,
  u'NAME': '',
  u'NRM': u'South East',
  u'OBSNETWORK': '',
  u'OBSNUMBER': '',
  u'OBSWELL': u'N',
  u'PERMIT_NO': '',
  u'PURP_DESC': u'STK',
  u'PWA': u'Lower Limestone Coast',
  u'REPLACEUNITNUM': '',
  u'SAL': u'Y',
  u'SALSTATUS': '',
  u'STAT_DESC': u'OPR',
  u'STRATLOG': u'N',
  u'SWL': 2.64,
  u'SWLSTATUS': '',
  u'TDS': 345,
  u'WATER': u'Y',
  u'YIELD': ''}]

In [ ]: